using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using ImageRecognition.Algorithms;
using surfInterop;

namespace ImageRecognition
{
    /// <summary>
    /// Holds the relevant data about a rectangular region where an object is
    /// presumed to exist.  Contains information about the posture
    /// of the object.
    /// </summary>
    //public class InterestWindow
    //{
    //    Rectangle _region;
    //    List<LikelyObject> _contents;
    //    public InterestWindow(IEnumerable<LikelyObject> objectMatches)
    //    {
    //        float Left = float.MaxValue, Right = 0f, 
    //              Top = float.MaxValue, Bottom = 0f;

    //        _contents = new List<LikelyObject>();

    //        foreach (LikelyObject o in objectMatches)
    //        {
    //            // Rubber-band the points with a rectangle
    //            foreach(PointF pt in o.Example.ProjectShape(o.AffineModel.Transform))
    //            {
    //                if (pt.X < Left) Left = pt.X;
    //                if (pt.X > Right) Right = pt.X;
    //                if (pt.Y < Top) Top = pt.Y;
    //                if (pt.Y > Bottom) Bottom = pt.Y;
    //            }

    //            _contents.Add(o);
    //        }

    //        _region = new Rectangle((int)Left, (int)Top, (int)(Right - Left), (int)(Bottom - Top));
    //    }
    //    public SurfKeypoint[] FilterKeypoints(SurfKeypoint[] all)
    //    {
    //        List<SurfKeypoint> inside = new List<SurfKeypoint>(all.Length);
    //        foreach (SurfKeypoint kpt in all)
    //        {
    //            if (_region.Contains(new Point((int)kpt.x, (int)kpt.y)))
    //                inside.Add(kpt);
    //        }
    //        return inside.ToArray();
    //    }
    //    public IList<LikelyObject> Objects { get { return _contents; } }
    //    public Rectangle Region { get { return _region; } }

    //}
}
